#include "util.h"
#include <stdio.h>

void swap(void* a, void* b){
    int* av = (int*) a;
    int* bv = (int*) b;
    int c = *av;
    *av = *bv;
    *bv = c;
}

int* copy(const int*  arr,int length){
    int* array = (int*)malloc(sizeof(int) * length);
    int i;
    for(i = 0; i < length; i++){
        array[i] = arr[i];
    }
    return array;
}

void printArray(int arr[], int length) {
    int i;
    for (i = 0; i < length; i++) {
        printf("%d ", arr[i]);
    }
    printf("\n");
}

void printDecollator() {
    printf("########\n");
}

void myFree(int* arr){
    free(arr);
    arr = NULL;
}